<?php


class Form_Test extends Zend_Form {

   public function __construct($options = null) {
      parent::__construct($options);

      $questions = $options['questions'];
      
      foreach($questions as $question) {
         $field = new Zend_Form_Element_TextArea('question'.$question->getId(), array(
            'label' => $question->getQuestion(), 'required' => true,
            'rows' => 10, 'cols' => 55
         ));
         $field->addFilter(new Zend_Filter_StringTrim())
               ->isRequired();
         $fields[] = $field;
      }
      $fields['submit'] = new Zend_Form_Element_Submit('login', array('label' => 'send'));
      
      $this->setName('test');
      $this->addElements($fields);
      $this->setMethod('post');
      $this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl(). '/courses/test');

   }



}